﻿using System;
using System.ComponentModel.Composition;
using Microsoft.Practices.Prism.Regions;
using BizControl.Presentation.ActivityEditModule.ViewModels;
using Microsoft.Practices.Prism;
using System.Windows.Controls;

namespace BizControl.Presentation.ActivityEditModule.Views
{
  [Export]
  [PartCreationPolicy(CreationPolicy.NonShared)]
  public partial class ActivityEditView : UserControl
  {
    public ActivityEditView()
    {
      InitializeComponent();
    }

    [ImportingConstructor]
    public ActivityEditView(ActivityEditViewModel viewModel)
      : this()
    {
      this.DataContext = viewModel;
    }

    public void ChangeTab(TabItem tab)
    {
      ActivityTabControl.SelectedItem = tab;
    }

    private void ManageParticipants_Click(object sender, System.Windows.RoutedEventArgs e)
    {
      ChangeTab(ParticipantsTab);
    }

    private void ManageActivity_Click(object sender, System.Windows.RoutedEventArgs e)
    {
      ChangeTab(ActivityTab);
    }

  }
}
